package com.jeeplus.modules.guide.entity;


import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.sys.utils.UserUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;

@Data
@ApiModel(value = "窗口办理表",description = "窗口办理表")
public class MobileQueueList {
    /**
     *idcard
     */
    private String idcard;

    /**
     *number
     */
    private String number;
    /**
     *cometime
     */
    private String cometime;
    /**
     *servertime
     */
    private String servertime;
    /**
     *endtime
     */
    private String endtime;
    /**
     *hjtime
     */
    private String hjtime;
    /**
     *typeName
     */
    private String typeName;
    /**
     *status
     */
    private String status;
    /**
     *doStatus
     */
    private String doStatus;
    /**
     *pjstatus
     */
    private String pjstatus;
    /**
     *wino
     */
    private String wino;
    /**
     *userNo
     */
    private String userNo;
    /**
     *userName
     */
    private String userName;

    /**
     *jhType
     */
    private String jhType;


    public void setDoStatus(String doStatus){
        if("0".equals(doStatus)){
            this.doStatus = "未叫号";
        }else{
            this.doStatus = "已叫号";
        }
    }

    public void setIdcard(String idcard){
        if(StringUtils.isNotBlank(idcard) && !UserUtils.getUser().getLoginName().equals("manager")){
            this.idcard = idcard.substring(0,5)+"********"+idcard.substring(13,idcard.length());
        }else{
            this.idcard = idcard;
        }
    }

    public void setPjstatus(String pjstatus){
        if("0".equals(pjstatus)){
            this.pjstatus = "未评价";
        }else{
            this.pjstatus = "已评价";
        }
        if("弃号".equals(this.jhType) || "转移".equals(this.jhType)){
            this.pjstatus = "无需评价";
        }

        if("受理未办理".equals(this.status)){
            this.pjstatus = "等待评价";
        }
    }

    public void setStatus(String status){
        if("0".equals(status)){
            this.status = "未受理";
        }else if("1".equals(status)){
            this.status = "受理未办理";
        }else{
            this.status = "已受理";
        }
        if("转移".equals(this.jhType)){
            this.status = "转移";
        }else if("弃号".equals(this.jhType)){
            this.status = "弃号";
        }
    }

}
